﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace Hook.Common
{
    public class KeyAndMouse
    {
        [DllImport("user32.dll")]
        public static extern UInt32 FindWindow(string lpClassName, string lpWindowName);
        [DllImport("user32.dll")]
        private static extern UInt32 FindWindowEx(UInt32 hwndParent, UInt32 hwndChildAfter, string lpClassName, string lpWindowName);
        [DllImport("user32.dll")]
        private static extern bool PostMessage(UInt32 hWnd, uint Msg, uint wParam, uint lParam);

        public static void SendKey(uint hwnd, uint keyValue)
        {
            PostMessage(hwnd, 0x102, keyValue, 1);
        }
    }
}
